unit unAcumulado;

interface

uses
 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
 Dialogs, DB, Grids, DBGrids, ThemeDBGrid, StdCtrls, Buttons;

type
 TfmAcumulado = class(TForm)
  ThemeDBGrid1: TThemeDBGrid;
  dsAcumulado: TDataSource;
  btGerar: TBitBtn;
  procedure btGerarClick(Sender: TObject);
 private
    { Private declarations }
 public
    { Public declarations }
 end;
 
var
 fmAcumulado: TfmAcumulado;
 
implementation

uses unDM;

{$R *.dfm}

procedure TfmAcumulado.btGerarClick(Sender: TObject);
begin
 dm.sqlTemp.Close;
 dm.sqlTemp.SQL.Clear;
 dm.sqlTemp.SQL.Text := 'SELECT * FROM pilotos ORDER BY nome;';
 dm.sqlTemp.Open;
 
 dm.sqlTemp.First;
 while not dm.sqlTemp.Eof do
  begin
  //'SELECT SUM(pontos) as pontos FROM pontuacao;'
  dm.sqlTemp.Next;
  end;
end;

end.

